#ifndef AFFILIATE_BAR_H
#define AFFILIATE_BAR_H
#include "../core/node_affiliate.h"

class affiliate_bar:public node_affiliate{
protected:
    float percent_ = 0.0f ;
    SDL_FColor color_high = {0,1,0,1};//绿色
    SDL_FColor color_mid = {0,0.65,0,1};//橙色
    SDL_FColor color_low = {1,0,0,1};//红色
public:
    static affiliate_bar* createABar(screen* parent,glm::vec2 size = glm::vec2(0),
        Anchor anchor = Anchor::ANCHOR_CENTER);
    virtual void render() override;
    float getPercent() const{ return percent_;};
    void setPercent(float percent){ percent_ = percent;};
    SDL_FColor getColorHigh() const{ return color_high;};
    SDL_FColor getColorMid() const{ return color_mid;};
    SDL_FColor getColorLow() const{ return color_low;};
    void setColorHigh(SDL_FColor color){ color_high = color;};
    void setColorMid(SDL_FColor color){ color_mid = color;};
    void setColorLow(SDL_FColor color){ color_low = color;};
};

#endif // AFFILIATE_BAR_H